namespace GGF
{
    namespace API
    {
        using System;
        using System.Diagnostics;

        /// <summary>
        /// Abstraction of the most atomic object in the gubb API: the list item.
        /// Currently only supports subset of API fields for this object.
        /// </summary>
        public class gItem
        {
            #region Fields

            int item_id;
            DateTime item_date_due;
            int item_list_id;
            string item_details;
            string item_note;
            int item_priority;

            #endregion Fields

            #region Constructors

            /// <summary>
            /// Constructor for an atomic item in a list.
            /// </summary>
            /// <param name="id">An int representing the item's unique ID in the list.</param>
            /// <returns>An object representing an item in a gubb list, ready
            /// to be stored with an instance of <see cref="GGF.API.gList"/>.</returns>
            public gItem(int id)
            {
                this.item_id = id;

                Debug.WriteLine("New item instantiated. id = " + id, "Item creation");
      
            }

            #endregion Constructors

            #region Properties

            ///<summary>
            ///Get or set the item's due date.
            ///</summary>
            /// <value>
            /// The item's due date using a standard .NET DateTime object
            /// from the System namespace.
            /// </value>
            public DateTime date_due
            {
                get { return item_date_due; }
                set { item_date_due = value; Debug.WriteLine("date_due modified for " + item_id, "Item modification"); }
            }

            ///<summary>
            ///Get or set the list ID that item belongs to.
            ///</summary>
            /// <value>
            /// The item's parent list ID using a standard .NET integer.
            /// </value>
            public int list_id
            {
                get { return item_list_id; }
                set { item_list_id = value; Debug.WriteLine("list_id modified for " + item_id, "Item modification"); }
            }

            ///<summary>
            ///Get or set the item's primary description text.
            ///</summary>
            /// <value>
            /// The item's primary text content, represented by a standard
            /// .NET string.
            /// </value>
            public string details
            {
                get { return item_details; }
                set { item_details = value; Debug.WriteLine("details modified for " + item_id, "Item modification"); }
            }

            ///<summary>
            ///Get or set the item's supplementary note text.
            ///</summary>
            /// <value>
            /// The item's supplementary note text content, represented
            /// by a standard .NET string.
            /// </value>
            public string note
            {
                get { return item_note; }
                set { item_note = value; Debug.WriteLine("note modified for " + item_id, "Item modification"); }
            }

            ///<summary>
            ///Gets or sets this item's priority.
            ///</summary>
            /// <value>
            /// The item's user-set priority, represented by a standard .NET integer.
            /// </value>
            public int priority
            {
                get { return item_priority; }
                set { item_priority = value; Debug.WriteLine("priority modified for " + item_id, "Item modification"); }
            }

            #endregion Properties

            #region Methods

            /// <summary>
            /// Returns this item's ID.
            /// <remarks>
            /// Item IDs are generally understood to have been initially
            /// assigned to an item by the API when the item was first
            /// created by user. In GGF, they usually are assigned
            /// to an item from an API request/response since API first creates
            /// and assigns them for access and processing.
            /// </remarks>
            /// </summary> 
            /// <returns>An integer denoting item's ID.</returns>
            public int getItemId()
            {
                return item_id;
            }

            #endregion Methods
        }
    }

}